﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Collections.Generic;
using control.Biz;


public partial class usercontrol_newprod : System.Web.UI.UserControl
{
    private List<BizSach> dataSource;
    public List<BizSach> DataSource
    {
        get
        {
            if (dataSource == null)
                dataSource = new List<BizSach>();
            return dataSource;
        }
        set { dataSource = value; }
    }
    private int soCot;
    public int SoCot
    {
        get { return soCot; }
        set { soCot = value; }
    }
    private int soSach;
    public int SoSach
    {
        get { return soSach; }
        set { soSach = value; }
    }
    private string tieuDe;
    public string TieuDe
    {
        get { return tieuDe; }
        set { tieuDe = value; }
    }
    public string Icon()
    {
        if (TieuDe == "Sách Mới")
            return "<img src='images/new_icon.gif' alt='' title='' />";
        else
            return null;

    }
    protected void Page_Load(object sender, EventArgs e)
    {

        if (!IsPostBack)
        {
            lbtitle.Text = TieuDe;
            PagedDataSource _page = new PagedDataSource();
            _page.DataSource = DataSource;
            _page.PageSize = SoSach;
            _page.AllowPaging = true;
            DataList1.DataSource = _page;
            DataList1.RepeatColumns = SoCot;
            DataList1.DataBind();
        }
    }
}
